home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 July / macformat52.iso / mac / Shareware Plus / Developers / YAAF v1.0 alpha 1 / Headers / Core / XDocument.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-24  |  2.7 KB  |  109 lines

  1. /*    XDocument.h
  2.  *
  3.  *        This is the root document class.
  4.  *
  5.  *        The way the document works is to insert itself in the XGDispatch
  6.  *    list between the XGAppCore class and the XGWindow which displays
  7.  *    the document's contents.
  8.  *
  9.  *        A document then can watch incomming messages and help regulate
  10.  *    how those messages are handled
  11.  */
  12.  
  13. /*  YAAF - Yet another application framework
  14.  *  Copyright (C) 1997 William Edward Woody and In Phase Consulting
  15.  *  
  16.  *  This library is free software; you can redistribute it
  17.  *  and/or modify it under the terms of the GNU Library
  18.  *  General Public License as published by the Free Software
  19.  *  Foundation; either version 2 of the License, or any
  20.  *  later version.
  21.  *  
  22.  *  This library is distributed in the hope that it will be
  23.  *  useful, but WITHOUT ANY WARRANTY; without even the implied
  24.  *  warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
  25.  *  PURPOSE. See the GNU Library General Public License for
  26.  *  more details.
  27.  *  
  28.  *  You should have received a copy of the GNU Library General
  29.  *  Public License along with this library; if not, write to the
  30.  *  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  31.  *  Boston, MA 02111-1307, USA.
  32.  *  
  33.  *  To contact the author, either e-mail me at
  34.  *  woody@alumni.caltech.edu, or write to us at
  35.  *  
  36.  *          William Edward Woody
  37.  *          In Phase Consulting
  38.  *          1545 Ard Eevin Avenue
  39.  *          Glendale, CA 91202
  40.  */
  41.  
  42. #ifndef __XDOCUMENT_H__
  43. #define __XDOCUMENT_H__
  44.  
  45. #include <XEvent.h>
  46.  
  47. #if defined(__MWERKS__)
  48.     #if defined(macintosh)
  49.         #pragma options align=power
  50.     #endif
  51.     #if defined(__INTEL__)
  52.         #pragma pack(push,2)
  53.     #endif
  54. #endif
  55.  
  56. /************************************************************************/
  57. /*                                                                        */
  58. /*    Randomness                                                            */
  59. /*                                                                        */
  60. /************************************************************************/
  61.  
  62. class XGWindow;
  63.  
  64. /************************************************************************/
  65. /*                                                                        */
  66. /*    Dirty/Save Support                                                    */
  67. /*                                                                        */
  68. /************************************************************************/
  69.  
  70. /*    XGDocument
  71.  *
  72.  *        This is the basic document class.
  73.  */
  74.  
  75. class XGDocument : public XGDispatch {
  76.     public:
  77.                                 XGDocument();
  78.         virtual                    ~XGDocument();
  79.         
  80.         /*
  81.          *    Document save/restore hooks
  82.          */
  83.         
  84.         virtual bool            IsNamed() = 0;
  85.         virtual bool            IsDirty() = 0;
  86.         virtual bool            DoSave() = 0;
  87.         virtual bool            DoSaveAs() = 0;
  88.         virtual void            DoRevert() = 0;
  89.         
  90.         /*
  91.          *    Message processing
  92.          */
  93.         
  94.         long                    ReceiveDispatch(long,long,void *);
  95. };
  96.  
  97.  
  98.  
  99. #if defined(__MWERKS__)
  100.     #if defined(macintosh)
  101.         #pragma options align=reset
  102.     #endif
  103.     #if defined(__INTEL__)
  104.         #pragma pack(pop)
  105.     #endif
  106. #endif
  107.  
  108. #endif /* __XDOCUMENT_H__ */
  109.